package br.xraylol.test.client;

import static org.junit.Assert.assertNotNull;

import java.util.ArrayList;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import br.xraylol.bean.riot.LeagueBean;
import br.xraylol.bean.riot.LeagueItemBean;
import br.xraylol.client.LeagueClient;
import br.xraylol.constant.GameSubType;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring-module.xml")
public class LeagueTestClient {
	
	@Autowired
	LeagueClient client;
	
	@Test
	public void findLeaguesBySummoner() {
		ArrayList<LeagueBean> leagues = client.findLeaguesBySummoner(2000861L);
		
		assertNotNull(leagues);
	}
	
	@Test
	public void findLeaguesEntryBySummoner() {
		ArrayList<LeagueItemBean> leagueItems = client.findLeaguesEntryBySummoner(2000861L);
		
		assertNotNull(leagueItems);
	}
	
	@Test
	public void findLeaguesByTeam() {
		ArrayList<LeagueBean> leagues = client.findLeaguesByTeam("a2422690-5719-11e3-883f-d4ae528a516a");
		
		assertNotNull(leagues);
	}
	
	@Test
	public void findLeaguesEntryByTeam() {
		ArrayList<LeagueItemBean> leagueItems = client.findLeaguesEntryByTeam("a2422690-5719-11e3-883f-d4ae528a516a");
		
		assertNotNull(leagueItems);
	}
	
	@Test
	public void findChallengerTierLeagues() {
		LeagueBean league = client.findChallengerTierLeague(GameSubType.RANKED_SOLO_5x5);
		
		assertNotNull(league);
	}
}
